@extends('admin.layout.layout')
<meta name="csrf-token" content="{{ csrf_token() }}">
@section('content')

	<div class="panel-body">
        <div class="row">
            <div class="col-lg-6 col-lg-offset-3">
                <form role="form" action="{{url('/admin/cate/insert')}}" method="post">
                   
                    <div class="form-group">
                        <label>商品分类添加</label>
                        <br><br>
                        <div class="notice_info jserror">
                            <!-- 提示信息预留框 -->
                            <div class="alert alert-info notice">
                                @if(session('errors'))
                                    @foreach($errors->all() as $error)
                                            {{$error}}
                                    @endforeach
                                @else
                                    请输入1到32个字符的商品分类名.(<b>:注意不能输入空格</b>)
                                @endif
                            </div>
                            <div>
                                <input class="form-control" type="text" name="catename1" placeholder="点击输入商品分类名"/>
                            </div>
                        </div>
                        <br><br>
                        <div  class="notice_info select1">
                            <div class="alert alert-info notice">
                                添加商品分类 (<b>请选择二级分类所属类:注意不能输入空格</b>)
                            </div>
                            <div>
                                <select class="form-control menu" name="menu1">
                                        <option value="null">请选择</option>
                                    @foreach($first as $v)
                                            <option value="{{$v->id}}" path="{{$v->path}}">{{$v->catename}}</option>    
                                    @endforeach
                                </select>
                            </div>
                            <br>
                            <div>
                                <input type="text" name="catename2" class="form-control" placeholder="点击输入商品分类名"/>
                            </div>
                        </div>
                        <br><br>
                        <div class="notice_info select2">
                            <div class="alert alert-info notice">
                                添加商品分类 (<b>请选择三级分类所属类:注意不能输入空格</b>)
                            </div>
                            <div class="second">
                                <select class="form-control menu" name="menu2">
                                        <option value="null">请选择</option>
                                    @foreach($second as $v)
                                        <option value="{{$v->id}}">{{$v->catename}}</option>
                                    @endforeach
                                </select>
                            </div>
                            <br>
                            <div>
                                <input type="text" name="catename3" class="form-control" placeholder="点击输入商品分类名"/>
                            </div>
                        </div>
                    </div><br>
                        {{ csrf_field() }}
                    <center>
                    	   <button class="btn btn-default cate_confirm">分类添加</button>
                    </center>
                </form>
            </div>
        </div>
    </div>
    <script>
        $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });
    </script>
   <script src="/public/admin/js/cate.js"></script>
@endsection

















